library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.6 ✓ dplyr 1.0.7
## ✓ tidyr 1.1.4 ✓ stringr 1.4.0
## ✓ readr 2.0.1 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(ggmap)
## Google's Terms of Service: https://cloud.google.com/maps-platform/terms/.
## Please cite ggmap if you use it! See citation("ggmap") for details.
library(ggplot2)
library(ggthemes)
library(forcats)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggmap':
##
## wind
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(leaflet)
NYPD_2020 = read.csv("../final data/2020data.csv") %>%
janitor::clean_names()
NYPD_2020 = NYPD_2020 %>%
filter(name_of_borough != "")
leaflet(NYPD_2020) %>%
addProviderTiles(providers$CartoDB.Positron) %>%
setView(lng = -73.935242, lat = 40.730610, zoom = 10) %>%
addMarkers(clusterOptions = markerClusterOptions())
## Assuming "longitude" and "latitude" are longitude and latitude, respectively